<?php

use App\Http\Controllers\Admin\ArticleCategoriesController;
use App\Http\Controllers\Admin\ArticleController;
use App\Http\Controllers\Admin\CertificateCategoryController;
use App\Http\Controllers\Admin\CertificateController;
use App\Http\Controllers\Admin\CertificationExaminationController;
use App\Http\Controllers\Admin\ClassGradeController;
use App\Http\Controllers\Admin\ClassStudentController;
use App\Http\Controllers\Admin\CourseCategoryController;
use App\Http\Controllers\Admin\CourseController;
use App\Http\Controllers\Admin\CourseLecturerController;
use App\Http\Controllers\Admin\CourseSectionController;
use App\Http\Controllers\Admin\CourseSectionQuestionAnswerBackController;
use App\Http\Controllers\Admin\CourseSectionQuestionAnswerController;
use App\Http\Controllers\Admin\CourseSectionResourcesController;
use App\Http\Controllers\Admin\CourseSectionVideoController;
use App\Http\Controllers\Admin\CourseSectionWorkController;
use App\Http\Controllers\Admin\ExamCategoryController;
use App\Http\Controllers\Admin\ExamPaperController;
use App\Http\Controllers\Admin\ExpertController;
use App\Http\Controllers\Admin\GoodsBrandController;
use App\Http\Controllers\Admin\GoodsCartController;
use App\Http\Controllers\Admin\GoodsCategoryController;
use App\Http\Controllers\Admin\GoodsController;
use App\Http\Controllers\Admin\GoodsOrderController;
use App\Http\Controllers\Admin\GoodsSpecsController;
use App\Http\Controllers\Admin\GoodsSpecsValueController;
use App\Http\Controllers\Admin\PermissionsController;
use App\Http\Controllers\Admin\PracticalTrainingController;
use App\Http\Controllers\Admin\PracticalTrainingEvaluationController;
use App\Http\Controllers\Admin\PracticalTrainingUserController;
use App\Http\Controllers\Admin\QuestionCategoryController;
use App\Http\Controllers\Admin\QuestionController;
use App\Http\Controllers\Admin\RoleController;
use App\Http\Controllers\Admin\SchoolController;
use App\Http\Controllers\Admin\SlideController;
use App\Http\Controllers\Admin\SmsController;
use App\Http\Controllers\Admin\StudentEvaluationController;
use App\Http\Controllers\Admin\SupplierController;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Admin\AuthController;
use App\Http\Controllers\Admin\UsersController;
use App\Http\Controllers\Admin\UserLoginLogController;



Route::post('login', [AuthController::class,'adminLogin']);
//
Route::group(['middleware'=>['checkAdmin']],function (){
    Route::get('logout', [AuthController::class,'logout']);
    Route::get('menu', [AuthController::class,'menuList']);

    # 角色模块
    Route::get('role/list', [RoleController::class,'index']);
    Route::post('role/add', [RoleController::class,'create']);
    Route::post('role/update', [RoleController::class,'update']);
    Route::post('role/delete', [RoleController::class,'destroy']);
    Route::get('role/permissions', [RoleController::class,'permissions']);
//    Route::post('role/permissions/save', [RoleController::class,'permissionsSave']);

    # 权限模块
    Route::post('permissions/file', [PermissionsController::class,'upfile']);
    Route::get('permissions/list', [PermissionsController::class,'list']);
    Route::get('permissions/listtree', [PermissionsController::class,'listTree']);
    Route::post('permissions/add', [PermissionsController::class,'add']);
    Route::post('permissions/update', [PermissionsController::class,'update']);
    Route::post('permissions/delete', [PermissionsController::class,'delete']);

    # 用户模块
    Route::post('users/file', [UsersController::class,'upfile']);
    Route::post('users/add', [UsersController::class,'add']);
    Route::post('users/update', [UsersController::class,'update']);
    Route::post('users/delete', [UsersController::class,'delete']);
    Route::get('users/list', [UsersController::class,'list']);
 Route::get('users/info', [UsersController::class,'userInfo']);
    Route::post('users/import', [UsersController::class,'usersImport']);

    # 学校模块
    Route::post('school/file', [SchoolController::class,'upfile']);
    Route::post('school/add', [SchoolController::class,'add']);
    Route::post('school/update', [SchoolController::class,'update']);
    Route::post('school/delete', [SchoolController::class,'delete']);
    Route::get('school/list', [SchoolController::class,'list']);
    Route::get('school/course', [SchoolController::class,'getSchoolCourse']);
    Route::post('school/course/add', [SchoolController::class,'addSchoolCourse']);
    Route::post('school/course/del', [SchoolController::class,'delSchoolCourse']);

    Route::get('school/course/ispossess', [SchoolController::class,'ispossess']);

    # 班级模块
    Route::post('class/add', [ClassGradeController::class,'add']);
    Route::post('class/update', [ClassGradeController::class,'update']);
    Route::post('class/delete', [ClassGradeController::class,'delete']);
    Route::get('class/list', [ClassGradeController::class,'list']);
    Route::get('class/course', [ClassGradeController::class,'getClassCourse']);
    Route::post('class/course/add', [ClassGradeController::class,'addSchoolClassCourse']);
    Route::post('class/course/del', [ClassGradeController::class,'delSchoolClassCourse']);

    # 班级学生

    Route::post('student/add', [ClassStudentController::class,'add']);
    Route::post('student/update', [ClassStudentController::class,'update']);
    Route::post('student/delete', [ClassStudentController::class,'delete']);
    Route::get('student/list', [ClassStudentController::class,'list']);
    Route::get('student/most', [ClassStudentController::class,'getMost']);

    # 幻灯片
    Route::post('slide/file', [SlideController::class,'upfile']);
    Route::post('slide/add', [SlideController::class,'add']);
    Route::post('slide/update', [SlideController::class,'update']);
    Route::post('slide/delete', [SlideController::class,'delete']);
    Route::get('slide/list', [SlideController::class,'list']);

    # 文章类型
    Route::post('article/categories/add', [ArticleCategoriesController::class,'add']);
    Route::post('article/categories/update', [ArticleCategoriesController::class,'update']);
    Route::post('article/categories/delete', [ArticleCategoriesController::class,'delete']);
    Route::get('article/categories/list', [ArticleCategoriesController::class,'list']);

    # 文章
    Route::post('article/file', [ArticleController::class,'upfile']);
    Route::post('article/add', [ArticleController::class,'add']);
    Route::post('article/update', [ArticleController::class,'update']);
    Route::post('article/delete', [ArticleController::class,'delete']);
    Route::get('article/list', [ArticleController::class,'list']);


    # 课程分类
    Route::post('course/category/add', [CourseCategoryController::class,'add']);
    Route::post('course/category/update', [CourseCategoryController::class,'update']);
    Route::post('course/category/delete', [CourseCategoryController::class,'delete']);

    # 课程讲师
    Route::post('course/lecturer/add', [CourseLecturerController::class,'add']);
    Route::post('course/lecturer/update', [CourseLecturerController::class,'update']);
    Route::post('course/lecturer/delete', [CourseLecturerController::class,'delete']);

    # 课程
    Route::post('course/add', [CourseController::class,'add']);
    Route::post('course/update', [CourseController::class,'update']);
    Route::post('course/delete', [CourseController::class,'delete']);

    Route::post('course/file', [CourseController::class,'upfile']);

    # 课程章节
    Route::post('course/section/add', [CourseSectionController::class,'add']);
    Route::post('course/section/update', [CourseSectionController::class,'update']);
    Route::post('course/section/delete', [CourseSectionController::class,'delete']);

    # 课程章节资源
    Route::post('course/section/resources/add', [CourseSectionResourcesController::class,'add']);
    Route::post('course/section/resources/delete', [CourseSectionResourcesController::class,'delete']);
    Route::post('course/section/resources/update', [CourseSectionResourcesController::class,'update']);
    Route::post('course/section/resources/file', [CourseSectionResourcesController::class,'upfile']);

    # 课程章节视频
    Route::post('course/section/video/add', [CourseSectionVideoController::class,'add']);
    Route::post('course/section/video/delete', [CourseSectionVideoController::class,'delete']);
    Route::post('course/section/video/update', [CourseSectionVideoController::class,'update']);

    Route::post('course/section/video/file', [CourseSectionVideoController::class,'vodFile']);


    # 课程章节作业
    Route::post('course/section/work/add', [CourseSectionWorkController::class,'add']);
    Route::post('course/section/work/delete', [CourseSectionWorkController::class,'delete']);
    Route::post('course/section/work/update', [CourseSectionWorkController::class,'update']);


    # 课程章节问答
    Route::post('course/section/issue/add', [CourseSectionQuestionAnswerController::class,'add']);
    Route::post('course/section/issue/delete', [CourseSectionQuestionAnswerController::class,'delete']);

    # 课程章节问答的回答
    Route::post('course/section/issue/comments/add', [CourseSectionQuestionAnswerBackController::class,'add']);
    Route::post('course/section/issue/comments/delete', [CourseSectionQuestionAnswerBackController::class,'delete']);
    Route::post('course/section/issue/comments/adopt', [CourseSectionQuestionAnswerBackController::class,'adopt']);
    # 课程章节作业
    Route::post('course/section/work/file', [CourseSectionWorkController::class,'upfile']);
    Route::post('student/work/add', [CourseSectionWorkController::class,'addStudentWork']);
    Route::post('student/work/update', [CourseSectionWorkController::class,'updateStudentWork']);

    # 课程章节学生评价
    Route::post('student/work/evaluation/update', [StudentEvaluationController::class,'updateStudentWork']);




});


#前端获取幻灯片
Route::get('slide/list/all', [SlideController::class,'listAll']);

#前端获取文章类型
Route::get('article/categories/listall', [ArticleCategoriesController::class,'listAll']);

#前端获取文章
Route::get('article/listall', [ArticleController::class,'listAll']);
Route::get('article/info', [ArticleController::class,'info']);

# 课程分类列表
Route::get('course/category/list', [CourseCategoryController::class,'list']);

# 课程讲师
Route::get('course/lecturer/list', [CourseLecturerController::class,'list']);

# 课程
Route::get('course/list', [CourseController::class,'list']);
Route::get('course/info', [CourseController::class,'getByCourseInfo']);
Route::get('course/notschool/course', [CourseController::class,'getNotSchoolCourse']);
Route::get('course/notschoolclass/course', [CourseController::class,'getNotSchoolClassCourse']);

# 课程章节
Route::get('course/section/list', [CourseSectionController::class,'list']);
Route::get('course/section/info', [CourseSectionController::class,'info']);

# 课程章节问答
Route::get('course/section/issue/list', [CourseSectionQuestionAnswerController::class,'list']);

# 课程章节问答的回答
Route::get('course/section/issue/comments/list', [CourseSectionQuestionAnswerBackController::class,'list']);

# 课程章节资源
Route::get('course/section/resources/list', [CourseSectionResourcesController::class,'list']);

# 课程章节作业
Route::get('course/section/work/list', [CourseSectionWorkController::class,'list']);
Route::get('course/section/work/most', [CourseSectionWorkController::class,'getMost']);
Route::get('student/work/list', [CourseSectionWorkController::class,'listStudentWork']);

# 课程章节学生评价
Route::get('student/work/evaluation/class', [StudentEvaluationController::class,'listSlass']);
Route::get('student/work/evaluation/list', [StudentEvaluationController::class,'listStudentWork']);

# 课程章节视频
Route::get('course/section/video/list', [CourseSectionVideoController::class,'list']);
Route::get('course/section/video/autograph', [CourseSectionVideoController::class,'getAutograph']);


#课程点赞/课程浏览量/文章浏览量/文章点赞

Route::post('course/pv', [CourseController::class,'addPV']);
Route::post('course/praise', [CourseController::class,'addPraise']);

Route::post('article/pv', [ArticleController::class,'addPV']);
Route::post('article/praise', [ArticleController::class,'addPraise']);

Route::post('course/section/issue/pv', [CourseSectionQuestionAnswerController::class,'addPV']);


#生产实训
Route::post('practical/add', [PracticalTrainingController::class,'add']);
Route::post('practical/update', [PracticalTrainingController::class,'update']);
Route::post('practical/file', [PracticalTrainingController::class,'upfile']);
Route::get('practical/list', [PracticalTrainingController::class,'list']);
Route::get('practical/user/list', [PracticalTrainingController::class,'userPracticalList']);

Route::post('practical/delete', [PracticalTrainingController::class,'delete']);
Route::get('practical/info', [PracticalTrainingController::class,'getByPracticalTrainingInfo']);

#生产实训用户结果
Route::post('practical/user/save', [PracticalTrainingUserController::class,'save']);
Route::get('practical/user/result/list', [PracticalTrainingUserController::class,'userPracticalList']);
Route::get('practical/user/info', [PracticalTrainingUserController::class,'getByPracticalTrainingUserInfo']);
Route::post('practical/user/file', [PracticalTrainingUserController::class,'upfile']);
Route::post('practical/user/delete', [PracticalTrainingUserController::class,'delete']);

#生产实训用户结果评价
Route::post('practical/evaluation/save', [PracticalTrainingEvaluationController::class,'save']);
Route::post('practical/evaluation/delete', [PracticalTrainingEvaluationController::class,'delete']);
Route::get('practical/evaluation/list', [PracticalTrainingEvaluationController::class,'list']);

#行业专家
Route::post('expert/save', [ExpertController::class,'save']);
Route::get('expert/list', [ExpertController::class,'list']);
Route::get('expert/info', [ExpertController::class,'info']);
Route::post('expert/file', [ExpertController::class,'upfile']);
Route::post('expert/delete', [ExpertController::class,'delete']);

#登录日志列表
Route::get('loginLog/list', [UserLoginLogController::class,'list']);

#游客日志
Route::post('touristLog/add', [UserLoginLogController::class,'touristAdd']);
Route::get('touristLog/list', [UserLoginLogController::class,'touristList']);
Route::get('touristLog/export', [UserLoginLogController::class,'exportTouristList']);

#商品
#商品品牌
Route::post('brand/save', [GoodsBrandController::class,'save']);
Route::get('brand/list', [GoodsBrandController::class,'list']);
Route::post('brand/file', [GoodsBrandController::class,'upfile']);
Route::post('brand/delete', [GoodsBrandController::class,'delete']);

#商品分类goods_category
Route::post('goods/category/save', [GoodsCategoryController::class,'save']);
Route::get('goods/category/listtree', [GoodsCategoryController::class,'listTree']);
Route::get('goods/category/plist', [GoodsCategoryController::class,'plist']);
Route::post('goods/category/delete', [GoodsCategoryController::class,'delete']);

#商品规格
Route::post('goods/specs/save', [GoodsSpecsController::class,'save']);
Route::get('goods/specs/list', [GoodsSpecsController::class,'list']);
Route::get('goods/specs/all', [GoodsSpecsController::class,'listAll']);
Route::post('goods/specs/delete', [GoodsSpecsController::class,'delete']);

#商品规格值
Route::post('goods/specs/val/save', [GoodsSpecsValueController::class,'save']);
Route::get('goods/specs/val/all', [GoodsSpecsValueController::class,'listAll']);
Route::post('goods/specs/val/delete', [GoodsSpecsValueController::class,'delete']);

#商品
Route::post('goods/save', [GoodsController::class,'save']);
Route::get('goods/update/info', [GoodsController::class,'updateInfo']);
Route::get('goods/sku/info', [GoodsController::class,'getSkuInfo']);
Route::post('goods/state', [GoodsController::class,'state']);
Route::post('goods/img', [GoodsController::class,'img']);
Route::get('goods/list', [GoodsController::class,'list']);
Route::get('goods/inventory/num', [GoodsOrderController::class,'inventoryNum']);

#购物车
Route::post('goods/cart/add', [GoodsCartController::class,'add']);
Route::post('goods/cart/update', [GoodsCartController::class,'update']);
Route::post('goods/cart/delete', [GoodsCartController::class,'delete']);
Route::get('goods/cart/list', [GoodsCartController::class,'list']);

#订单
Route::post('goods/order/add', [GoodsOrderController::class,'add']);
Route::post('goods/order/tourist/add', [GoodsOrderController::class,'touristAdd']);
Route::get('goods/order/list', [GoodsOrderController::class,'list']);
Route::get('goods/order/info', [GoodsOrderController::class,'info']);
Route::post('goods/order/state/update', [GoodsOrderController::class,'stateUpdate']);
#用户订单信息
Route::get('user/goods/order/info', [GoodsOrderController::class,'userInfo']);
#供应商
Route::post('supplier/add', [SupplierController::class,'add']);
Route::post('supplier/update', [SupplierController::class,'update']);
Route::post('supplier/img', [SupplierController::class,'img']);
Route::post('supplier/delete', [SupplierController::class,'delete']);
Route::get('supplier/list', [SupplierController::class,'list']);
Route::get('supplier/info', [SupplierController::class,'info']);
Route::post('supplier/allocation/order', [SupplierController::class,'allocationOrder']);
Route::get('supplier/order/list', [SupplierController::class,'supplierOrderlist']);
Route::get('supplier/order/tourist/list', [SupplierController::class,'touristSupplierOrderlist']);
Route::get('supplier/order/unallocated/list', [SupplierController::class,'unallocatedSupplierOrderlist']);

#供应商分配学校
Route::get('supplier/notSchool', [SupplierController::class,'notAllocationSchool']);
Route::post('supplier/allocationSchool', [SupplierController::class,'allocationSchool']);
#供应商登录
Route::post('supplier/login', [SupplierController::class,'supplierLogin']);
Route::get('supplier/logout', [SupplierController::class,'logout']);


Route::post('sms/send/msg', [SmsController::class,'SendMsg']);
Route::post('sms/send/code', [SmsController::class,'SendCode']);
Route::post('sms/send/verify/code', [SmsController::class,'verifyCodeCorrect']);

#证书类别
Route::post('certificate/category/save', [CertificateCategoryController::class,'save']);
Route::post('certificate/category/del', [CertificateCategoryController::class,'delete']);
Route::get('certificate/category/list', [CertificateCategoryController::class,'list']);

#证书
Route::post('certificate/save', [CertificateController::class,'save']);
Route::post('certificate/del', [CertificateController::class,'delete']);
Route::get('certificate/list', [CertificateController::class,'list']);
Route::post('certificate/img', [CertificateController::class,'img']);
Route::get('certificate/unpaper/all', [CertificateController::class,'allArr']);

#试题类别
Route::post('question/category/save', [QuestionCategoryController::class,'save']);
Route::post('question/category/del', [QuestionCategoryController::class,'delete']);
Route::get('question/category/list', [QuestionCategoryController::class,'list']);
Route::get('question/category/all', [QuestionCategoryController::class,'allArr']);


#试题
Route::post('question/save', [QuestionController::class,'save']);
Route::post('question/del', [QuestionController::class,'delete']);
Route::get('question/list', [QuestionController::class,'list']);
Route::get('question/info', [QuestionController::class,'getInfo']);
#试卷类别
Route::post('exam/category/save', [ExamCategoryController::class,'save']);
Route::post('exam/category/del', [ExamCategoryController::class,'delete']);
Route::get('exam/category/list', [ExamCategoryController::class,'list']);
#试卷
Route::post('exam/paper/save', [ExamPaperController::class,'save']);
Route::post('exam/paper/publish', [ExamPaperController::class,'publishPage']);
Route::post('exam/paper/del', [ExamPaperController::class,'delete']);
Route::get('exam/paper/list', [ExamPaperController::class,'list']);
Route::get('exam/paper/info', [ExamPaperController::class,'getInfo']);
Route::post('exam/paper/quick', [ExamPaperController::class,'generateQuickExam']);
Route::post('exam/paper/add/question', [ExamPaperController::class,'addPaperQuestion']);
Route::post('exam/paper/edit/question', [ExamPaperController::class,'editPaperQuestion']);
Route::post('exam/paper/del/question', [ExamPaperController::class,'deletePaperQuestion']);
Route::get('exam/paper/list/question', [ExamPaperController::class,'listPaperQuestion']);
Route::get('exam/paper/unreferenced/question', [ExamPaperController::class,'unreferencedQuestion']);

Route::post('exam/paper/update/question/score', [ExamPaperController::class,'updateQuestionScore']);
Route::post('exam/paper/question/move/up', [ExamPaperController::class,'moveUp']);
Route::post('exam/paper/question/move/down', [ExamPaperController::class,'moveDown']);
Route::get('exam/paper/user/list/', [ExamPaperController::class,'userPaperList']);
Route::get('exam/paper/user/info/', [ExamPaperController::class,'userPaperInfo']);
#认证考试
Route::get('certification/examination/info', [CertificationExaminationController::class,'getCertificationExaminationInfo']);
Route::get('certification/examination/questions', [CertificationExaminationController::class,'certificationQuestions']);
Route::get('certification/answer/progress', [CertificationExaminationController::class,'answerProgress']);
//Route::post('certification/save/page', [CertificationExaminationController::class,'savePage']);
Route::post('certification/save/question', [CertificationExaminationController::class,'savePageQuestion']);
Route::get('certification/page/result', [CertificationExaminationController::class,'paperResult']);
Route::get('certification/user/info', [CertificationExaminationController::class,'certificationInfo']);

Route::post('certification/save/question/file', [CertificationExaminationController::class,'userQuestionFile']);





